home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19970326-19970626
/
000240_news@newsmaster….columbia.edu _Tue May 27 12:06:29 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
2KB
Return-Path: <news@newsmaster.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id MAA19913
for <kermit.misc@watsun.cc.columbia.edu>; Tue, 27 May 1997 12:06:28 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id MAA20268
for kermit.misc@watsun; Tue, 27 May 1997 12:06:28 -0400 (EDT)
Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: simple test for controlling terminal?
Date: 27 May 1997 16:06:22 GMT
Organization: Columbia University
Lines: 28
Message-ID: <5mf0pu$jot$1@newsmaster.cc.columbia.edu>
References: <5mctd1$h7f@gateway.dircsa.org.au>
NNTP-Posting-Host: watsun.cc.columbia.edu
Xref: news.columbia.edu comp.protocols.kermit.misc:7085
In article <5mctd1$h7f@gateway.dircsa.org.au>,
Arthur Marsh <arthur@gateway.dircsa.org.au> wrote:
: Hi, I do have the fine C-Kermit manual, but wondered what the simplest
: way to get a Kermit script to quit if the script was not run from a serial
: tty.
:
That's a good question. I think the answer would depend on the precise
UNIX version and release and configuration. In the general case, UNIX
provides no way to tell whether a device is a serial tty or a pseudoterminal.
: In other words, what would be the proper C-Kermit script to compare a
: substring to achieve the same result as:
:
: if not (first 8 characters of \$(LOGTTY) = "/dev/tty") then quit
:
But your login tty is always "/dev/tty". Maybe you have something in the
system-wide profile like:
export LOGTTY=`tty`
String comparison, of course, is the easy part:
if not equal "\fsubstring(\$(LOGTTY),1,8)" "/dev/tty" stop 1 blah blah
You could do something like make a list of the serial devices on your computer
and then look it up in the list (hint: use arrays).
- Frank